-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wchar deserialize error when swaping the bytes #186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems work fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richiprosima Hi richiprosima,
Can you help review the code and allow patch submissions?
This patch will fix issues #185.
Please be patient. Currently most of eProsima developers are in holiday vacations. We will review your contribution in the next few weeks. Sorry for the wait. |
Hi @hwwei521 thank you for using Fast DDS and for your contribution!
Could you include another commit with a regression test including the way you test it (as you have described above) to keep track of it? |
Hi, Jesús
|
Hi, Jesús |
@JesusPoderoso |
Signed-off-by: weihanwu <weihanwu@lixiang.com>
Signed-off-by: weihanwu <weihanwu@lixiang.com> Co-authored-by: maxin <maxin@lixiang.com>
ece6aa4
to
d6ee7d2
Compare
I rebased this on top of master, and included the test from #190 |
Signed-off-by: Miguel Company <miguelcompany@eprosima.com> Co-authored-by: Ricardo González <correoricky@gmail.com>
b6e2d79
to
5a0eb23
Compare
Going in. Thank you @hwwei521 for your contribution! |
* Regression test for #185 in SimpleTest Signed-off-by: weihanwu <weihanwu@lixiang.com> * Fix wchar deserialize error when swaping the bytes Signed-off-by: weihanwu <weihanwu@lixiang.com> Co-authored-by: maxin <maxin@lixiang.com> * Apply suggestion Signed-off-by: Miguel Company <miguelcompany@eprosima.com> Co-authored-by: Ricardo González <correoricky@gmail.com> --------- Signed-off-by: weihanwu <weihanwu@lixiang.com> Co-authored-by: maxin <maxin@lixiang.com> Co-authored-by: Miguel Company <miguelcompany@eprosima.com> Co-authored-by: Ricardo González <correoricky@gmail.com>
After downloading the latest Fast-CDR, I verified Fast-CDR's functionality by following the steps below:
When I wanted to test the performance in the case of CDR swap, I changed the
Cdr cdr_ser(cdrbuffer)
andCdr cdr_des(cdrbuffer)
of theTEST(CDRTests, Complete)
test entry toCdr cdr_ser(cdrbuffer, eprosima::fastcdr::Cdr::Endianness::BIG_ENDIANNESS)
andCdr cdr_des(cdrbuffer, eprosima::fastcdr::Cdr::Endianness::BIG_ENDIANNESS)
respectively. To make the test and the current test environment default processor Endianness inconsistent, forced to trigger the processing of CDR swap, found in EXPECT_EQ (wcscmp(c_wstring_t, c_wstring_value), 0) reported an error.I found that swap is not considered in the
Cdr& Cdr::serialize(wchar_t*& string_t)
function, so I replaced it withdeserialize_array(string_t, length)
, and it works fine.